home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK2.toast / Development Kits (Disc 2) / ScriptX / Code Samples / hapyhols / loadme.sx < prev   
Encoding:
Text File  |  1996-05-21  |  2.8 KB  |  76 lines  |  [TEXT/ttxt]

  1. --<<<-
  2. --*******************************************************************************
  3. --*          Demo for:    HolidayCard
  4. --*    Required files: reqFiles/animate.sx
  5. --*                    media.sxl
  6. --*                    holiday.sx
  7. --*            Author:    Su Quek - Kaleida Labs, Inc.
  8. --*           Artwork:    Kathleen Pierce
  9. --*-----------------------------------------------------------------------------*
  10. --*       Description: This script demonstrates how to animate an object by moving 
  11. --*                    it across the screen or flipping its bitmaps.
  12. --*                    The tickle method of the GroupPresenter is used to move the
  13. --*                    object across the screen and the Animation class handles
  14. --*                    the bitmap flipping.
  15. --*                    When you run "holiday.sxt", you should see a window
  16. --*                    with a snowy background scene and 4 penguins pulling a 
  17. --*                    K-man on a sleigh with a banner flying across the screen.
  18. --*                    Note that each penguin is 'flapping' at different rates.
  19. --*                    To replay the 'flyby', you have re-open "holiday.sxt".
  20. --*******************************************************************************
  21.  
  22. module HolidayModule
  23.     uses ScriptX
  24. end
  25.  
  26. in module HolidayModule
  27.  
  28. --*=============================================================================*
  29. --* Set up DirReps
  30. --*=============================================================================*
  31. global demoDir := theScriptDir
  32. global reqFilesDir := spawn theScriptDir "reqfiles"
  33. global mediaDir := spawn theScriptDir "media"
  34.  
  35. --*=============================================================================*
  36. --* Load required files
  37. --*=============================================================================*
  38. -- Load Animation
  39. fileIn reqFilesDir name:"animate.sx"
  40.  
  41. -- Load HolidayCard
  42. fileIn demoDir name:"holiday.sx"
  43.  
  44. --*=============================================================================*
  45. --*    Create a title container
  46. --*=============================================================================*
  47. object tc (TitleContainer)
  48.     dir        : theScriptDir
  49.     path    : "holiday.sxt" 
  50.     name    : "Happy Holidays"
  51. end        
  52.     
  53. --*=============================================================================*
  54. --*    Create demo
  55. --*=============================================================================*
  56. object demo (HolidayCard)
  57.     title:tc
  58. end
  59.  
  60. --*=============================================================================*
  61. --*    Undefine global DirReps
  62. --*=============================================================================*
  63. demoDir := undefined
  64. reqFilesDir := undefined
  65. mediaDir := undefined
  66.  
  67. --*=============================================================================*
  68. --*    Store module in the title container
  69. --*=============================================================================*
  70. append tc (getModule @HolidayModule)
  71. tc.startUpAction := (tc ->    load tc[1]
  72.                             show demo
  73.                             start demo)
  74. close tc
  75. -->>>
  76.